Skip to content

Change result-service to storage-service#40

Closed
brucetony wants to merge 1 commit intomainfrom
39-update-component-name-for-new-storage-service
Closed

Change result-service to storage-service#40
brucetony wants to merge 1 commit intomainfrom
39-update-component-name-for-new-storage-service

Conversation

@brucetony
Copy link
Copy Markdown
Collaborator

@brucetony brucetony commented Feb 10, 2026

Summary by CodeRabbit

  • Refactor
    • Updated service naming conventions in configuration generation and cleanup operations to standardize storage-service terminology.

@brucetony brucetony linked an issue Feb 10, 2026 that may be closed by this pull request
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Feb 10, 2026

📝 Walkthrough

Walkthrough

The changes rename references from "result service" to "storage service" across nginx configuration generation and cleanup utilities, including variable names, proxy targets, comments, and pod lookup logic. No public APIs or function signatures are modified.

Changes

Cohort / File(s) Summary
Service Naming Updates
src/k8s/kubernetes.py, src/resources/utils.py
Consistent renaming of result service references to storage service throughout nginx configuration generation and pod cleanup logic, updating variable names, proxy targets, comments, and pod label selectors.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Possibly related issues

Poem

🐰 The rabbit hops through code with glee,
Where storage now replaces the result tree,
Variables dance in perfect harmony,
Service names bloom, as consistent they be! 🌿

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and accurately describes the main change: renaming the result-service component to storage-service across the codebase.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 39-update-component-name-for-new-storage-service

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/k8s/kubernetes.py (1)

387-441: ⚠️ Potential issue | 🟠 Major

Guard against non-unique or missing storage-service lookup.

get_k8s_resource_names may return None or list[str], which would render an invalid proxy_pass target. Consider enforcing a single service name before generating the config.

🔧 Proposed fix
     storage_service_name = get_k8s_resource_names('service',
                                                  'label',
                                                  'component=flame-storage-service',
                                                  namespace=namespace)
+    if not isinstance(storage_service_name, str):
+        raise ValueError(
+            f"Expected a single storage-service name, got: {storage_service_name!r}"
+        )
🤖 Fix all issues with AI agents
In `@src/resources/utils.py`:
- Around line 215-222: get_k8s_resource_names may return None or a list; before
calling delete_resource you must normalize storage_service_name to a list, skip
when empty/None, and call delete_resource for each pod name. Specifically, in
the block that handles cleanup_type (where storage_service_name is assigned from
get_k8s_resource_names), replace the direct delete_resource call with logic
that: (1) checks if storage_service_name is truthy, (2) if it's a string convert
it into a single-item list, (3) iterate the list and call delete_resource(name,
'pod', namespace) for each entry, and (4) set response_content[cleanup_type]
only after performing deletions (or set a helpful message if no pods were
found). Ensure you reference the existing symbols get_k8s_resource_names,
delete_resource, storage_service_name, cleanup_type, namespace, and
response_content.

Comment on lines 215 to +222
if cleanup_type in ['all', 'services', 'rs']:
# reinitialize result-service pod
result_service_name = get_k8s_resource_names('pod',
# reinitialize storage-service pod
storage_service_name = get_k8s_resource_names('pod',
'label',
'component=flame-result-service',
'component=flame-storage-service',
namespace=namespace)
delete_resource(result_service_name, 'pod', namespace)
response_content[cleanup_type] = "Reset result service"
delete_resource(storage_service_name, 'pod', namespace)
response_content[cleanup_type] = "Reset storage service"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Handle multiple or missing storage-service pods during cleanup.

get_k8s_resource_names('pod', ...) can return None or list[str]. Passing either to delete_resource will fail. Consider normalizing to a list and skipping when empty.

🔧 Proposed fix
-                storage_service_name = get_k8s_resource_names('pod',
-                                                             'label',
-                                                             'component=flame-storage-service',
-                                                             namespace=namespace)
-                delete_resource(storage_service_name, 'pod', namespace)
-                response_content[cleanup_type] = "Reset storage service"
+                storage_service_names = get_k8s_resource_names('pod',
+                                                              'label',
+                                                              'component=flame-storage-service',
+                                                              namespace=namespace)
+                if storage_service_names is None:
+                    response_content[cleanup_type] = "No storage service pod found"
+                else:
+                    if isinstance(storage_service_names, str):
+                        storage_service_names = [storage_service_names]
+                    for pod_name in storage_service_names:
+                        delete_resource(pod_name, 'pod', namespace)
+                    response_content[cleanup_type] = "Reset storage service"
🤖 Prompt for AI Agents
In `@src/resources/utils.py` around lines 215 - 222, get_k8s_resource_names may
return None or a list; before calling delete_resource you must normalize
storage_service_name to a list, skip when empty/None, and call delete_resource
for each pod name. Specifically, in the block that handles cleanup_type (where
storage_service_name is assigned from get_k8s_resource_names), replace the
direct delete_resource call with logic that: (1) checks if storage_service_name
is truthy, (2) if it's a string convert it into a single-item list, (3) iterate
the list and call delete_resource(name, 'pod', namespace) for each entry, and
(4) set response_content[cleanup_type] only after performing deletions (or set a
helpful message if no pods were found). Ensure you reference the existing
symbols get_k8s_resource_names, delete_resource, storage_service_name,
cleanup_type, namespace, and response_content.

@Nightknight3000
Copy link
Copy Markdown
Member

Changes have been applied in #41 (no clue why this branch was left loose)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update component name for new storage service

2 participants